
****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************
****************************************************************************************    POPULATION ANALYSIS  ***********************************************************************************************
****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************

clear
use "Brancati_admndly_final.dta"

**Generate Variables and Interactions for POPULATION Models*
gen oxfstring_popdensity000 = oxfstringindex*popdensity000
gen lockdown_oxf40_popdensity000 = lockdown_oxf40*popdensity000
gen lockdown_oxf50_popdensity000 = lockdown_oxf50*popdensity000
gen lockdown_oxf60_popdensity000 = lockdown_oxf60*popdensity000
gen lkdn_oxfmvnt_base = lkdn_oxfmvnt*base 
gen rebelattknonciv_admdly = rebelattk_admdly-rebelattkcivln_admdly


****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************
***********************************************************************  POPULATION MODELS: POISSON CONDITIONAL FE  ********************************************************************************************
****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************
 
  
**TABLE 21:  Population Density Interactions (Poisson, FE) **

xtset isonum 

*Model 1:
xtpoisson rebelattk_admdly oxfstringindex oxfstring_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, fe 
test oxfstringindex oxfstring_popdensity000 popdensity000 

*Model 2*
xtpoisson rebelattk_admdly lockdown_oxf40 lockdown_oxf40_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, fe
 test lockdown_oxf40 lockdown_oxf40_popdensity000 popdensity000

*Model 3* [Figure 4a]
xtpoisson rebelattk_admdly lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, fe
gen esample50 = e(sample)
test lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000

*Model 4*
xtpoisson rebelattk_admdly lockdown_oxf60 lockdown_oxf60_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, fe
test lockdown_oxf60 lockdown_oxf60_popdensity000 popdensity000



**TABLE 22: Population Density Interactions-Time (Poisson, FE) **
*Model 1:
xtpoisson rebelattk_admdly oxfstringindex oxfstring_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory year, fe 
test oxfstringindex oxfstring_popdensity000 popdensity000 

*Model 2:
xtpoisson rebelattk_admdly lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory year, fe
test lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000

*Model 3:
xtpoisson rebelattk_admdly oxfstringindex oxfstring_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory monthno, fe 
test oxfstringindex oxfstring_popdensity000 popdensity000 

*Model 4:
xtpoisson rebelattk_admdly lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory monthno, fe
test lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000



**Table 23: Population Density Interactions-Additional Models (Poisson, FE),  Economic Interactions*

*Model 1*
gen lockdownoxf50_popdensity000 = lockdown_oxf50*popdensity000
poisson rebelattk_admdly lockdown_oxf50 popdensity000 lockdownoxf50_popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance  state_territory contested_territory i.isonum, cluster(admin1)
test lockdownoxf50 popdensity000 lockdownoxf50_popdensity000 

*Model 2: GDP AND POPULATION DENSITY)*
gen lnrealGDP_lag = ln(realGDP_lag)
gen lnrealGDPlag_popdensity000 = lnrealGDP_lag*popdensity000
poisson rebelattk_admdly lockdown_oxf50 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory lnrealGDPlag_popdensity000 lnrealGDP_lag  i.isonum, cluster(admin1)
test popdensity000 lnrealGDPlag lnrealGDPlag_popdensity000 

*Model 3: UNEMPLOYMENT AND POPULATION DENSITY*
gen unemploylag_popdensity000 = unemploy_lag*popdensity000
poisson rebelattk_admdly lockdown_oxf50 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory unemploylag_popdensity000 unemploy_lag i.isonum, cluster(admin1)
test popdensity000 unemploylag_popdensity000 unemploy_lag

****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************
****************************************************************************  POPULATION MODELS: PPML FE *******************************************************************************************************
****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************
  
**TABLE 24: Population Density Interactions (PPML FE and Clustered SE) **

*Model 1:
ppmlhdfe rebelattk_admdly oxfstringindex oxfstring_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, absorb(iso) vce(cluster districtid) d
test oxfstringindex oxfstring_popdensity000 popdensity000 

*Model 2*
ppmlhdfe rebelattk_admdly lockdown_oxf40 lockdown_oxf40_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, absorb(iso) vce(cluster districtid) d
test lockdown_oxf40 lockdown_oxf40_popdensity000 popdensity000

*Model 3*
ppmlhdfe rebelattk_admdly lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, absorb(iso) vce(cluster districtid) d
test lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000

*Model 4*
ppmlhdfe rebelattk_admdly lockdown_oxf60 lockdown_oxf60_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, absorb(iso) vce(cluster districtid) d
test lockdown_oxf60 lockdown_oxf60_popdensity000 popdensity000


****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************
****************************************************************************  POPULATION MODELS: ZIP MODELS  ***************************************************************************************************
****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************

**TABLE 25: Population Density Interactions (ZIP and Clustered SE) **

*Model 1:
zip rebelattk_admdly oxfstringindex oxfstring_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, inflate(v2x_polyarchy_lag) vce(cluster districtid)
test oxfstringindex oxfstring_popdensity000 popdensity000 

*Model 2*
zip rebelattk_admdly lockdown_oxf40 lockdown_oxf40_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, inflate(v2x_polyarchy_lag) vce(cluster districtid)
test lockdown_oxf40 lockdown_oxf40_popdensity000 popdensity000

*Model 3*
zip rebelattk_admdly lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, inflate(v2x_polyarchy_lag) vce(cluster districtid)
test lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000

*Model 4*
zip rebelattk_admdly lockdown_oxf60 lockdown_oxf60_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, inflate(v2x_polyarchy_lag) vce(cluster districtid)
test lockdown_oxf60 lockdown_oxf60_popdensity000 popdensity000

****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************
***********************************************************************  BASE OF OPERATION MODELS: OLS AND LOGIT  *********************************************************************************************
****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************
 

**TABLE 26: Base District Model Interactions (OLS FE, Logit Clustered SE)**
 
*Model 1*
xtreg prop000 lkdn_oxfmvnt lkdn_oxfmvnt_base base popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, fe
test lkdn_oxfmvnt lkdn_oxfmvnt_base base

*Model 2 [same sample as FE Poisson with lockdown (50)]* Figure 4b
xtreg prop000 lkdn_oxfmvnt lkdn_oxfmvnt_base base popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory if esample50==1, fe
test lkdn_oxfmvnt lkdn_oxfmvnt_base base
	
*Model 3 	
logit prop000 lkdn_oxfmvnt lkdn_oxfmvnt_base base popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, vce (cluster admin1) 
test lkdn_oxfmvnt lkdn_oxfmvnt_base base
   
  
****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************
************************************************************************  CIVILIANS ONLY MODELS (POISSON, PPML, ZIP)  ******************************************************************************************
****************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************
 


**TABLE 27: Population Density Interactions-No Civilians (Poisson, PPML, ZIP) **

*Model 1:
xtpoisson rebelattknonciv_admdly oxfstringindex oxfstring_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, fe 
test oxfstringindex oxfstring_popdensity000 popdensity000 
 

*Model 2* 
xtpoisson rebelattknonciv_admdly lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, fe
test lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000
  

*Model 3:  
ppmlhdfe rebelattknonciv_admdly oxfstringindex oxfstring_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, absorb(iso) vce(cluster districtid) d
test oxfstringindex oxfstring_popdensity000 popdensity000 
 

*Model 4*
ppmlhdfe rebelattknonciv_admdly lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, absorb(iso) vce(cluster districtid) d
test lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000


*Model 5:
zip rebelattknonciv_admdly oxfstringindex oxfstring_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, inflate(v2x_polyarchy_lag) vce(cluster districtid)
test oxfstringindex oxfstring_popdensity000 popdensity000 

*Model 6*
zip rebelattknonciv_admdly lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000 popmil sizekm2 stateattk_admwkly_lag deaths_wklag entrance exit state_territory contested_territory, inflate(v2x_polyarchy_lag) vce(cluster districtid)
test lockdown_oxf50 lockdown_oxf50_popdensity000 popdensity000
 